package cn.wuxuan.dao;

import cn.wuxuan.util.BaseDao;
import cn.wuxuan.util.BaseDaoImpl;
import cn.wuxuan.po.User;

public class UserDaoImpl implements UserDao {

	User user = null;
	BaseDao baseDao = new BaseDaoImpl();
	@Override
	public User selectName(String name) {
		String sql = "select * from t_user where name = '"+name+"'";
			user = baseDao.selectSingleRow(User.class, sql);
		return user;
	}

	@Override
	public Integer verifyUser(User u) {
		Integer count=0;
		String name = u.getName();
		user = selectName(name);
		if(user!=null&&u.getPwd().equals(user.getPwd())){
				count = 1;
		}
		return count;
	}

	@Override
	public Integer checkTitle(String title) {
		String sql = "select * from t_task where title = '"+title+"'";
		return 0;
	}

}
